package com.yuntsg.nnsfcp.util.httpclient;

import org.apache.http.client.config.RequestConfig;

public class LoadInfo {

    public static String IP_ADDRESS = "";
    public static int IP_PORT = 10086;
    public static String USER = "";
    public static String PWD = "";
	
	/*public static void init(Map<String,String> map)
	{
		try
		{
			USER=map.get("username");
			PWD=map.get("password");
			if(!StringUtil.isEmpty(map.get("iport"))) {
				IP_ADDRESS=map.get("iport").split(":")[0];
				IP_PORT=Integer.parseInt(map.get("iport").split(":")[1]);
			}

			System.out.println("LoadInfo下的用户信息:"+map.get("gid")+" "+map.get("nid")+" "+USER+" "+PWD+" "+IP_ADDRESS+" "+IP_PORT);
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}*/
	
	/*public static CredentialsProvider build(){
		CredentialsProvider credsProvider = new BasicCredentialsProvider();
		credsProvider.setCredentials(new AuthScope(IP_ADDRESS,IP_PORT), (Credentials) new UsernamePasswordCredentials(USER, PWD));
		return credsProvider;
	}*/

    public static RequestConfig buildRequestConfigure() {
        RequestConfig requestConfig = RequestConfig.custom()
                .setSocketTimeout(25000).setConnectTimeout(25000)
                //.setProxy(new HttpHost(IP_ADDRESS,IP_PORT))
                .build();// 设置请求和传输超时时间
        return requestConfig;
    }

    /*	*//**redirectFlag作为是否进行循环跳转的资源处理*//*
	public static RequestConfig buildNoProxyRequestConfigure(boolean redirectFlag){
		RequestConfig requestConfig = RequestConfig.custom().setRedirectsEnabled(redirectFlag)
				.setSocketTimeout(10000).setConnectTimeout(10000)
				.build();// 设置请求和传输超时时间
		return requestConfig;
	}*/

/*	public static RequestConfig buildRequestConfigure1(){
		RequestConfig requestConfig = RequestConfig.custom().setRedirectsEnabled(false)
				.setSocketTimeout(25000).setConnectTimeout(25000).setProxy(new HttpHost(IP_ADDRESS,IP_PORT))
				.build();// 设置请求和传输超时时间
		return requestConfig;
	}

	public static RequestConfig buildSwitchRedirectRequestConfigure(boolean flag){
		RequestConfig requestConfig = RequestConfig.custom().setRedirectsEnabled(flag)
				.setSocketTimeout(25000).setConnectTimeout(25000).setProxy(new HttpHost(IP_ADDRESS,IP_PORT))
				.build();// 设置请求和传输超时时间
		return requestConfig;
	}*/


}
